package main

import (
	"fmt"
	//"time"
)

//var sum int

func main() {

	//fmt.Println("hello world")

	//test_pipe()

	/*fmt.Println("start goroute")
	go test_pipe()
	fmt.Println("end goroute")

	time.Sleep(10*time.Second)*/

	/*var pipe chan int
	pipe = make(chan int, 3)
	go add(100, 300, pipe)

	sum = <-pipe //假如pipe里面没有数据，则会阻塞在这里 两个goroute之间同步的结果
	fmt.Println("sum = ", sum)*/

	/*sum,avg := calc(120, 260)
	fmt.Println("sum = ", sum, " avg= ", avg)*/
	sum,_ := calc(120, 260)
	fmt.Println("sum = ", sum)

}
